package com.atguigu.chaptar3

import com.alibaba.fastjson.JSON
import com.alibaba.fastjson.serializer.SerializeFilter

object Private {
  class Person{
  var name:String=_
  var age:Int=_
    def setName(name:String)=this.name=name
    def getName()=this.name
    def setAge(age:Int)=this.age=age
    def getAge()=this.age
  }
  def main(args: Array[String]): Unit = {
    val person = new Person
    person.setAge(15)
    person.setName("wzx")
    println(person.getAge())
    println(person.getName())
    val str = JSON.toJSONString(person, null.asInstanceOf[SerializeFilter])
    println(str)
  }

}
